<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib   prefix="c"  
			uri="http://java.sun.com/jsp/jstl/core"  %>
<%@ taglib   prefix="fmt"  
			uri="http://java.sun.com/jsp/jstl/fmt"  %>
<%@ taglib prefix="s"  uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>C.C. COURIER</title>
<link  href="style.css" type="text/css" rel="stylesheet"/>
</head>

<body>
<table width="666" height="317" border="0" align="center" cellpadding="0" cellspacing="0" id="gestionar">
  <tr>
    <td height="192" align="center"><img src="imagenes/logo.jpg" width="445" height="144" /></td>
  </tr>
  <tr>
    <td height="27" id="titulo">GESTIONAR ORDEN DE SERVICIO</td>
  </tr>
  <tr>
    <td>
    	<div id="cont1">
        <!-- parte 1 -->
        <table width="100%" border="0" cellpadding="0" cellspacing="5">
          <tr>
            <td width="26%">Criterio de Busqueda</td>
             <td width="9%">
           	<s:form action="buscarSolicitudesServicio" method="post" >
           		<s:textfield name="solicitudServicioDTO.idsolicitudservicio" label="Codigo"/>
           	 	<s:textfield name="solicitudServicioDTO.fechasolicituds" label="Fecha"/>
           	 	<s:textfield name="solicitudServicioDTO.idcliente" label="Cliente"/>
           	 	<s:select label="Destino" name="solicitudServicioDTO.departamentodestinatario" headerKey="1" headerValue="--Seleccionar--"
           	 	 	 	  list="#{'Lima':'Lima','Piura':'Piura','Arequipa':'Arequipa','Tacna':'Tacna','Iquitos':'Iquitos'}"/>
           	 	<s:submit value="Cargar Solicitudes" /> 	 	  
           	</s:form> 
             </td>
          </tr>
        </table>
        <!-- /parte 1 -->
        <!-- parte 2 -->
        <table width="97%" border="0" cellpadding="0" cellspacing="5">
      <tr>
        <td colspan="2">Solicitudes de Servicio Pendientes</td>
        <td width="31%" colspan="2"></td>
        </tr>
      <tr>
        <td colspan="4" align="center"><table width="609" class="box-table-a" summary="Employee Pay Sheet">
          <thead>
            <tr>
              <th width="185" scope="col">Codigo</th>
              <th width="118" scope="col">Cliente</th>
              <th width="145" scope="col">Fecha</th>
              <th width="132" scope="col">Destino</th>
              <th width="132" scope="col"></th>
            </tr>
          </thead>
          <tbody>
             <c:if test="${requestScope.listaSolicitudServicioDTO!=null}"   >
				
					<c:forEach items="${requestScope.listaSolicitudServicioDTO}" var="bean">
						 
						  <s:url id="verOS" action="cargarOrdenServicio"  >					     	
						     	<s:param name="ordenServicioDTO.idordenservicio" >   
						     		${bean.idordenservicio}
						     	</s:param>
						 </s:url>
				          <tr>
				            <td width="185" scope="col"><span class="textoformulario">${bean.idsolicitudservicio}</span></td>
						    <td width="118" scope="col"><span class="textoformulario">${bean.idcliente}</span></td>
				            <td width="145" scope="col"><span class="textoformulario">${bean.fechasolicituds}</span></td>
				            <td width="132" scope="col"><span class="textoformulario">${bean.departamentodestinatario}</span></td>
				            <td width="132" scope="col"><a href="${verOS}" > Ver Orden de Servicio</a></td>
		 		          </tr>
          			 </c:forEach>
		  </c:if>
            
            
            
            
            
            
          </tbody>
        </table></td>
      </tr>
    </table>
        <!-- /parte 2-->
        </div>
    </td>
  </tr>
  <tr>
   <s:form action="grabarOrdenServicio" method="post" > 
    <td>
    	<div id="cont2">
       
           <fieldset>
           <legend><strong>ORDEN DE SERVICIO</strong></legend>
           <table width="95%" border="0" cellpadding="0" cellspacing="5">
              <tr>
                <td> <s:textfield name="ordenServicioDTO.idordenservicio"  label="Codigo de Solicitud"/></td>
                <td><s:textfield name="ordenServicioDTO.fechaordens"  label="Fecha"/></td>
              </tr>
           </table>
           <br />
           <fieldset>
           <legend><strong>CLIENTE</strong></legend>
                  
                
                  <table width="96%" border="0" cellpadding="0" cellspacing="5">
                  <tr>
                    <td><s:textfield name="ordenServicioDTO.nombrecliente"  label="Cliente"/></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td><s:textfield name="ordenServicioDTO.idcliente"  label="Numero ID"/></td>
                    <td><s:select label="Tipo DNI" name="ordenServicioDTO.tipodoccliente" headerKey="1" 
           	 	 	 	  list="#{'DNI':'DNI','RUC':'RUC'}"/>
           	 			</td>
                  </tr>
                </table>
           </fieldset>
           <br />
           <fieldset>
           <legend><strong>DESTINO</strong></legend>
           <table width="100%" border="0" cellpadding="0" cellspacing="5">
             <tr>
               <td width="14%"><s:textfield name="ordenServicioDTO.destinatario"  label=" Destinatario"/></td>
               </tr>
             <tr>
               <td><s:textfield name="ordenServicioDTO.iddestinatario"  label="Numero ID"/></td>
               <td width="17%"><s:select label="Tipo DNI" name="ordenServicioDTO.tipodoccliente" headerKey="1" 
           	 	 	 	  list="#{'DNI':'DNI','RUC':'RUC'}"/></td>
             </tr>
             <tr>
               <td><s:textfield name="ordenServicioDTO.direcciondestinatario"  label="Direccion"/></td>
               </tr>
           </table>
         
           </fieldset>
           <br />
           <fieldset>
           <legend><strong>MERCADERIA</strong></legend>
           <table width="100%" border="0" cellpadding="0" cellspacing="5">
             <tr>
               <td><label>
                 <input type="submit" name="button" id="button" value="Cotizar Servicio" style="float:right" />
               </label></td>
               </tr>
             <tr>
               <td><table width="718" class="box-table-a" summary="Employee Pay Sheet">
                 <thead>
                   <tr>
                     <th width="115" scope="col">Producto</th>
                     <th width="90" scope="col">Tipo</th>
                     <th width="67" scope="col">Peso</th>
                     <th width="94" scope="col">Cantidad</th>
                     <th width="136" scope="col">Prec. Unit</th>
                     <th width="70" scope="col">Valor</th>
                     </tr>
                 </thead>
                 <tbody>
                    <c:if test="${requestScope.listMercaderiaDTO!=null}"   >
				
					<c:forEach items="${requestScope.listMercaderiaDTO}" var="bean">
						 
				          <tr>
				            <td width="115" scope="col"><span class="textoformulario">${bean.nombreproducto}</span></td>
						    <td width="90" scope="col"><span class="textoformulario">${bean.tipo}</span></td>
				            <td width="67" scope="col"><span class="textoformulario">${bean.peso}</span></td>
				            <td width="94" scope="col"><span class="textoformulario">${bean.cantidad}</span></td>
    			             <td width="136" scope="col"><span class="textoformulario">${bean.punit}</span></td>
				            <td width="70" scope="col"><span class="textoformulario">${bean.valor}</span></td>
				         
				          </tr>
          			 </c:forEach>
		  </c:if>
                  
                 </tbody>
               </table></td>
             </tr>
             <tr>
               <td align="right">
               <s:textfield name="ordenServicioDTO.subtotal"  label="Sub-Total"/>
               </td>
               </tr>
             <tr>
               <td align="right">
                  <s:textfield name="ordenServicioDTO.total"  label="Total"/>
              </td>
               </tr>
                  <tr>
   					 <td> <s:submit value="Generar Orden de Servicio"   /></td>  <td>            <a href="Registrar_Guia_de_Remision2.jsp">Reguistrar Guia Remision</a></td>
   				 </tr>
           </table>
           

           </fieldset>
           
         
           </fieldset>
           
       
        </div>
    </td>
   
      </s:form>
  </tr>
 
    </table>
    </div>
    </td>
  </tr>
</table>
</body>
</html>
